Repository Public
1import type { Metadata } from "next";2import { Feed } from "@/components/Feed";3import { Header } from "@/components/SiteChrome";4import { listFilms } from "@/lib/films";5import { dict, href, type Locale } from "@/lib/i18n";67export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }): Promise<Metadata> {8 const locale = (await params).locale as Locale;9 return { title: dict(locale).nav.feed, alternates: { canonical: href(locale, "/feed"), languages: { en: "/feed", fr: "/fr/feed" } } };10}1112export default async function FeedPage({ params, searchParams }: { params: Promise<{ locale: string }>; searchParams: Promise<Record<string, string | undefined>> }) {13 const locale = (await params).locale as Locale;14 const sp = await searchParams;15 const t = dict(locale);16 const series = sp.series?.slice(0, 60), tag = sp.tag?.slice(0, 60);17 const { films, nextCursor } = await listFilms(locale, { limit: 6, series, tag });18 const query = `${series ? `&series=${encodeURIComponent(series)}` : ""}${tag ? `&tag=${encodeURIComponent(tag)}` : ""}`;19 return (20 <>21 <Header locale={locale} overlay />22 <main id="main">23 <h1 className="sr-only">{t.nav.feed}</h1>24 <Feed initial={films} nextCursor={nextCursor} locale={locale} base={locale === "fr" ? "/fr" : ""} query={query}25 labels={{ player: t.player, actions: t.film, next: t.player.next, previous: t.player.previous, details: t.player.details, end: t.feed.end, back: t.feed.back, empty: t.feed.empty, hint: t.feed.hint, ai: t.film.aiDisclosure }} />26 </main>27 </>28 );29}30